<script lang="ts">
import type { LabelHTMLAttributes } from 'vue'
import type { PolymorphicProps } from '../factory'

export interface RatingGroupLabelBaseProps extends PolymorphicProps {}
export interface RatingGroupLabelProps
  extends RatingGroupLabelBaseProps,
    /**
     * @vue-ignore
     */
    LabelHTMLAttributes {}
</script>

<script setup lang="ts">
import { ark } from '../factory'
import { useRatingGroupContext } from './use-rating-group-context'
import { useForwardExpose } from '../../utils/use-forward-expose'

defineProps<RatingGroupLabelProps>()
const ratingGroup = useRatingGroupContext()

useForwardExpose()
</script>

<template>
  <ark.label v-bind="ratingGroup.getLabelProps()" :as-child="asChild">
    <slot />
  </ark.label>
</template>
